package asionreachel.cn.smarthomedemo.base;


import asionreachel.cn.smarthomedemo.R;
import asionreachel.cn.smarthomedemo.data.CDeviceTypeInfo;
import familyclient.android.common.JToolFunc;

/**
 * Created by SuperMa on 2017/5/8.
 */

public class ConstantDefinition {
    public final static String LOGIN_ACCOUNTID = "accountId";
    public final static String LOGIN_PASSWORD = "password";
    public final static boolean m_bIsDebug = true;
    public final static String LOGIN_EMAIL = "email";
    public final static String LOGIN_PHONE = "phone";
    public final static String LOGIN_PASSWORD_REMENBER = "isRemember";
    public final static String LOGIN_PASSWORD_HIDE = "login_password_hide";

    public static CDeviceTypeInfo m_selectDeviceTypeData;
    //15999624438 123456
    public final static String EDIT_PARM = "edit_parm";
    public final static String EDIT_CONTENT = "edit_content";
    public final static String EDIT_RESULT_CODE = "edit_result_code";
    public final static String EDIT_MAX_EMS = "edit_max_ems";
    public final static String EDIT_TITLE = "edit_title";
    public final static String EX_PARM = "ex_parm";
    public final static String CDM1 = "CDM1";

    public static enum CDeviceInfo
    {
//        CD01("中控", -1 , R.drawable.cd01_online, ConstantDefinition.CD01),       //索引会在初始化数据时候重新排序
//        CL01("彩灯", -1 , R.drawable.cl01_online, ConstantDefinition.CL01),
//        OF02("级联插座", -1 , R.drawable.of02_online, ConstantDefinition.OF02),
//        OF03("三开开关", -1 , R.drawable.of03_online, ConstantDefinition.OF03),
//        RC01("浴霸伴侣", -1 , R.drawable.rc01_online, ConstantDefinition.RC01),
//        RC02("遥控替身", -1 , R.drawable.rc02_online, ConstantDefinition.RC02),
        CDM1("娃娃机", -1 , R.drawable.cdm1_online, ConstantDefinition.CDM1);
//        SHB2("鞋柜", -1 , R.drawable.shb2_online, ConstantDefinition.SHB2),
//        RG01("级联插座", -1 , R.drawable.rg01_online, ConstantDefinition.RG01),;

        private String deviceName;
        private int deviceIndex;
        private int deviceIcon;
        private String deviceTag;

        CDeviceInfo(String a_strName, int a_iIndex, int a_iIcon , String a_strTag) {
            this.deviceName = a_strName ;
            this.deviceIndex = a_iIndex;
            this.deviceIcon = a_iIcon;
            this.deviceTag = a_strTag;
        }

        public void setIndex(int a_iIndex)
        {
            this.deviceIndex = a_iIndex;
        }

        public String getName()
        {
            return this.deviceName;
        }

        public int getIcon()
        {
            return deviceIcon;
        }

        public int getIndex()
        {
            return deviceIndex;
        }

        public String getTag()
        {
            return deviceTag;
        }

        public static CDeviceInfo getDeviceInfo( String a_strTag )
        {
            for( CDeviceInfo device : CDeviceInfo.values() )
            {
                if( a_strTag.equals( device.getTag() ) )
                    return device;
            }
            return null;
        }

        public static String getTagByDeviceID( String a_strDeviceID )
        {
            return JToolFunc.DeviceIDToDeviceType( a_strDeviceID );
        }
    }
}

